<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%@ taglib prefix="pg" tagdir="/WEB-INF/tags" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>待发货订单列表(等待商家发货)</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.tabfont01 {	
	font-family: "宋体";
	font-size: 9px;
	color: #555555;
	text-decoration: none;
	text-align: center;
}
.font051 {font-family: "宋体";
	font-size: 12px;
	color: #333333;
	text-decoration: none;
	line-height: 20px;
}
.font201 {font-family: "宋体";
	font-size: 12px;
	color: #FF0000;
	text-decoration: none;
}
.button {
	font-family: "宋体";
	font-size: 14px;
	height: 37px;
}
html { overflow-x: auto; overflow-y: auto; border:0;} 
table tr td{line-height: 22px;}
-->
</style>
<link href="<c:url value="/styles/ad/css.css"/>" rel="stylesheet" type="text/css" />
<link href="<c:url value="/styles/ad/style.css"/>" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<c:url value="/scripts/jquery-1.4.4.min.js"/>"></script>
<SCRIPT language=JavaScript>
function ship(obj,ocode){
	if(confirm("确认已收到付款？")){
	  	 $.ajax({
		   		url : "<c:url value='/order/ship'/>",
		   		type : "post",
		   		data:"ocode="+ocode,
		   		dataType:"json",
		   		success : function(data) {
		   			var bool = data.message;
		   			if(bool == "true"){
		   				$(obj).parent().html("<span style='color:green'>已发货</span>");
		   			}else{
		   				alert("操作失败");
		   			}
		   		}
		   	});
	}
}

</SCRIPT>
</head>
<body>
<form name="fom" id="fom" method="post" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  
  <tr>
    <td height="20"></td></tr>
  <tr>
    <td><table id="subtree1" style="DISPLAY: " width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td height="40" class="font42">
				<table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#464646" class="newfont03">
				 <tr class="CTitle" >
                    	<td height="22" colspan="7" align="center" style="font-size:16px">待发货订单列表(等待商家发货)</td>
                  </tr>
                  <tr bgcolor="#EEEEEE">
                    <td width="10%">订单编号</td>
                    <td width="35%">商品列表</td>
                    <td width="6%">收货人</td>
                    <td width=20%>收货人地址</td>
                    <td width="7%">订单金额</td>
                    <td width="12%">下单时间</td>
                    <td>操作</td>
                  </tr>
                  <c:forEach items="${myreviews}" var="review">
				  <tr bgcolor="#FFFFFF">
                    <td>${review.key}</td>
					<td>
					    <c:forEach items="${review.value}" var="product">
					        <div><a href="<c:url value="/product/goToDetail?pcode=${product.get('pcode')}"/>" target="_blank">名称：${product.get("pname")}</a>&nbsp;&nbsp;单价：${product.get("phyprice")}元 &nbsp;&nbsp;数量：${product.get("psum")}</div>
					    </c:forEach>
					</td>
					<td>${review.value.get(0).get('name')}</td>
					<td>${review.value.get(0).get('addr')}<br>(${review.value.get(0).get('shouhuo')})</td>
					<td>${review.value.get(0).get("oprice")}元</td>
					<td>${review.value.get(0).get("otime")}</td>
					<td><a href="javascript:void(0);" onclick="ship(this,'${review.value.get(0).get('ocode')}')">发货</a></td>
                  </tr>
                  </c:forEach>
                <tr bgcolor="#EEEEEE">
				<td align="center" colspan="7"	style=" line-height: 40px">
						<pg:paging
							currentPage="${myreviewPage.getPageNumber()}"
							baseUrl="?keyword=${keyword}&start-time=${start}&end-time=${end}&reco-state=${state}&" total="${myreviewPage.getTotalRow()}" 
							pageSize="55"></pg:paging></td>
				</tr>
            </table></td>
        </tr>
      </table>
</td>
  </tr>
</table>
</form>
</body>
</html>